﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DigitsRecognizer.BussinesLogic
{
    public class DrawField
    {
        protected Point coordinates;      // współrzędne służce do narysowania pola
        protected bool isDrawn;

        public DrawField() {
            coordinates = new Point();
            isDrawn = false;
        }

        public DrawField(Point coordinates)
        {
            this.coordinates = coordinates;
            isDrawn = false;
        }

        public Point Coordinates
        {
            get { return this.coordinates; }
        }

        public bool IsDrawn
        {
            get { return this.isDrawn; }
            set { isDrawn = value; }
        }


        #region operators
        public static bool operator ==(DrawField left, Point right) 
        {
            return left.Coordinates.X == right.X && left.Coordinates.Y == right.Y;
        }

        public static bool operator !=(DrawField left, Point right)
        {
            return left.Coordinates.X != right.X && left.Coordinates.Y != right.Y;
        }

        public static bool operator <(DrawField left, Point right)
        {
            return left.Coordinates.X < right.X && left.Coordinates.Y < right.Y;
        }

        public static bool operator >(DrawField left, Point right)
        {
            return left.Coordinates.X > right.X && left.Coordinates.Y > right.Y;
        }

        public static bool operator <=(DrawField left, Point right)
        {
            return left.Coordinates.X <= right.X && left.Coordinates.Y <= right.Y;
        }

        public static bool operator >=(DrawField left, Point right)
        {
            return left.Coordinates.X >= right.X && left.Coordinates.Y >= right.Y;
        }
        #endregion
    }
}
